package skins {
    import flash.display.GradientType;
    
    import mx.skins.halo.ButtonSkin;
    
    public class RequestRoomSkin extends ButtonSkin {
        
        //------------------------------------------------------------
        //
        // constructor
        //
        //------------------------------------------------------------
        
        public function RequestRoomSkin() {
            super();
        }
        
        override protected function updateDisplayList(w:Number, h:Number):void {
            super.updateDisplayList(w, h);
            
            graphics.clear();
            
            var cornerRadius:uint = getStyle("cornerRadius");
            
            // border thickness
            var bdt:uint = getStyle("borderThickness");
            
            switch (name) {
                case "selectedUpSkin":
                case "selectedOverSkin": {
                    drawRoundRect(0, 0, w, h, cornerRadius,
                        [0x000000, 0x777777], 1,
                        verticalGradientMatrix(0, 0, w, h),
                        GradientType.LINEAR, null);
                    break;
                }
                
                case "upSkin": {
                    drawRoundRect(0, 0, w, h, cornerRadius,
                        0x000000, 0.9,
                        verticalGradientMatrix(0, 0, w, h),
                        GradientType.LINEAR, null,
                        {x: bdt, y: bdt, w: w - bdt * 2, h: h - bdt * 2, r: cornerRadius - 1});
                        
                    drawRoundRect(1, 1, w - 2, h - 2, cornerRadius - 1,
                        [0xD2EDFF, 0xE1F3FF], 1,
                        verticalGradientMatrix(0, 0, w, h),
                        GradientType.LINEAR, null);
                    break;
                }
                
                case "overSkin": {
                    drawRoundRect(0, 0, w, h, cornerRadius,
                        [0x000000, 0x777777], 1,
                        verticalGradientMatrix(0, 0, w, h),
                        GradientType.LINEAR, null);
                    break;
                }
                
                case "downSkin":
                case "selectedDownSkin": {
                    drawRoundRect(1, 1, w - 2, h - 2, cornerRadius,
                        [0x000000, 0x777777], 1,
                        verticalGradientMatrix(0, 0, w, h),
                        GradientType.LINEAR, null);
                    break;
                }
                
                case "disabledSkin":
                case "selectedDisabledSkin": {
                    drawRoundRect(0, 0, w, h, cornerRadius,
                        [0x000000, 0x777777], 1,
                        verticalGradientMatrix(0, 0, w, h),
                        GradientType.LINEAR, null);
                    break;
                }
            }
        }
    
    }
}

